package me.linczh.bank.dao;

import me.linczh.bank.dao.impl.DBAccountDao;
import me.linczh.bank.dao.impl.DBAccountStatisticDao;
import me.linczh.bank.dao.impl.DBEmployeeDao;
import me.linczh.bank.dao.impl.DBLogDao;
import me.linczh.bank.dao.impl.DBOperatorDao;
import me.linczh.bank.dao.impl.FileAccountDao;
import me.linczh.bank.dao.impl.FileAccountStatisticDao;
import me.linczh.bank.dao.impl.FileEmployeeDao;
import me.linczh.bank.dao.impl.FileLogDao;
import me.linczh.bank.dao.impl.FileOperatorDao;

public class DaoFactory {
	public static String STORE = "FILE";
	
	private DaoFactory() {}
	
	public static AccountDao getAccountDao() {
		if (STORE.equals("FILE")) return new FileAccountDao();
		else return new DBAccountDao();
	}
	
	public static AccountStatisticDao getAccountStatisticDao() {
		if (STORE.equals("FILE")) return new FileAccountStatisticDao();
		else return new DBAccountStatisticDao();
	}
	
	public static EmployeeDao getEmployeeDao() {
		if (STORE.equals("FILE")) return new FileEmployeeDao();
		else return new DBEmployeeDao();
	}
	
	public static LogDao getLogDao() {
		if (STORE.equals("FILE")) return new FileLogDao();
		else return new DBLogDao();
	}
	
	public static OperatorDao getOperatorDao() {
		if (STORE.equals("FILE")) return new FileOperatorDao();
		else return new DBOperatorDao();
	}
}
